package com.drinkdelivery.front.controller;

import com.drinkdelivery.common.core.controller.BaseController;
import com.drinkdelivery.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author lzhCreate
 * @create 2024-07-26 9:49
 */
@Slf4j
@RestController
@RequestMapping("/front/index")
@Api(tags = "首页")
public class IndexController extends BaseController {

//    @Autowired
//    private IProductsService productsService;

//    @Autowired
//    private ICategoriesService categoriesService;
//
//    @ApiOperation(value = "首页展示")
//    @GetMapping(value = "/list")
//    public Map<String, TableDataInfo> list() {
//        startPage();
//        List<Products> products = productsService.selectProductsList(new Products());
//        TableDataInfo dataTable = getDataTable(products);
//
//        List<Categories> categories = categoriesService.selectCategoriesList(new Categories());
//        TableDataInfo dataTable2 = getDataTable(categories);
//        Map<String, TableDataInfo> map = new HashMap<>();
//        map.put("products", dataTable);
//        map.put("categories", dataTable2);
//        return map;
//    }

//    @ApiOperation(value = "根据分类id查询商品")
//    @GetMapping(value = "/{categoryId}/products")
//    public TableDataInfo getProductsByCid(@PathVariable(value = "categoryId") Integer cid) {
//        startPage();
//        List<Products> productsByCid = productsService.getProductsByCid(cid);
//        return getDataTable(productsByCid);
//    }



}
